<g:each in="${postInstance?.comments?.sort{it?.dateCreated}}" status="i" var="comment">
    <div id="comment${comment.id}" class="commentBg">
        <h4 class="commentTitle">
            ${comment?.title.encodeAsHTML()}
        </h4>
        <div class="commentByLine">
            ${comment?.anonymousName.encodeAsHTML()} 评论于
            <g:formatDate format="yyyy-MM-dd" date="${comment.dateCreated}"/>
             <g:formatDate format="h:mm" date="${comment.dateCreated}"/>
             
        </div>
        <div class="commentContent">
            ${comment?.content.encodeAsHTML()}
        </div>
        <g:if test="${session.loginID == comment?.commenter?.id}">
            <div class="commentContent">
                <g:link controller="postedComment" action="edit" id="${comment?.id}" params="[postID:postInstance.id]">修改</g:link>
		        <g:link controller="postedComment" action="delete" onclick="return confirm('确定删除此博文吗?');" id="${comment.id}" params="[postID:postInstance.id]">删除</g:link>
            </div>
        </g:if>
        <g:else>
            <jsec:hasRole  in="['SUPER_ADMIN']">
                <div class="commentContent">
                <g:link controller="postedComment" action="edit" id="${comment?.id}" params="[postID:postInstance.id]">修改</g:link>
		        <g:link controller="postedComment" action="delete" onclick="return confirm('确定删除此博文吗?');" id="${comment.id}" params="[postID:postInstance.id]">删除</g:link>
                </div>
            </jsec:hasRole>
        </g:else>
    </div>
    <div class="dots"></div>
</g:each>